#!/usr/bin/expect
set timeout 1000
set host [lindex $argv 0]
set createCluster [lindex $argv 1]
set password [lindex $argv 2]

spawn ssh root@$host "$createCluster"
expect {
 "(yes/no)?"
  {
  send "yes\n"
  expect "*assword:" { send "$password\n"
  		expect "(type 'yes' to accept):"{send "yes\n"}
	}
 }
 "*assword:"
{
 send "$password\n"
 expect "(type 'yes' to accept):"{send "yes\n"}
}
}
expect eof